package question.solution263;

import question.SolutionTemplate;

import java.util.List;
import java.util.Stack;

public class Solution263 implements SolutionTemplate {

    public boolean isUgly(int n) {
        if(n<=0){
            return false;
        }

        while(n%2==0){
            n=n/2;
        }
        while(n%3==0){
            n=n/3;
        }
        while(n%5==0){
            n=n/5;
        }
        if(n == 1){
            return true;
        }
        return false;
    }

    @Override
    public void test() {

    }

}
